package org.hh.netty.entity;

import javafx.scene.image.Image;

import java.io.Serializable;
import java.util.Random;

public class User implements Serializable {
    String name;
    Image image;
    static int num = new Random().nextInt(16)+1;
    static Image sysImage = new Image(User.class.getClassLoader().getResourceAsStream("img/"+num+".jpeg"));
    static User user = new User("系统消息", sysImage);

    public User() {
    }

    public User(String name, Image image) {
        this.name = name;
        this.image = image;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        this.image = image;
    }

    /**
     * 获取系统用户
     * @return
     */
    public static User getSystemUser(){
        return user;
    }
}
